package com.raports;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;

/**
 *
 * @author Sawior
 */
public class RaportMenuScreenController implements Initializable, RaportControlledScreen {

    private RaportScreensController myController;
    @FXML
    private Button earnings;
    @FXML
    private Button passes;
    @FXML
    private Button tarrifs;
    @FXML
    private Button spaces;
    @FXML
    private Button cars;
    @FXML
    private Button clients;
    @FXML
    private Button parking;
    
    @FXML
    private void handleButtonAction(ActionEvent event) {
        if(event.getSource()==passes){
            myController.setScreen(RaportScreensFramework.RAPORT_PASSES);
        }
        if(event.getSource()==tarrifs){
            myController.setScreen(RaportScreensFramework.RAPORT_TARRIFS);
        }
        if(event.getSource()==spaces){
            myController.setScreen(RaportScreensFramework.RAPORT_SPACES);
        }
        if(event.getSource()==cars){
            myController.setScreen(RaportScreensFramework.RAPORT_CARS);
        }
        if(event.getSource()==earnings){
            myController.setScreen(RaportScreensFramework.RAPORT_FINANCE);
        }
        if(event.getSource()==clients){
            myController.setScreen(RaportScreensFramework.RAPORT_CLIENTS);
        }
        if(event.getSource()==parking){
            myController.setScreen(RaportScreensFramework.RAPORT_BUTTONS);
        }
    }
    
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        
    }
    
    @Override
    public void setScreenParent(RaportScreensController screenParent) {
        myController = screenParent;
    }

}
